home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / moonstonemadness.swf / scripts / __Packages / Library / DispatcherBase.as < prev    next >
Text File  |  2007-09-27  |  1KB  |  52 lines

  1. class Library.DispatcherBase
  2. {
  3.    function DispatcherBase()
  4.    {
  5.       this.bPaused = false;
  6.       this.aListeners = new Array();
  7.    }
  8.    function doEnterFrame()
  9.    {
  10.       if(!this.bPaused)
  11.       {
  12.          this.doDispatchMessage("doEnterFrame");
  13.       }
  14.    }
  15.    function doAddListener(__oRef)
  16.    {
  17.       this.aListeners.push(__oRef);
  18.    }
  19.    function doRemoveListener(__oRef)
  20.    {
  21.       for(var _loc2_ in this.aListeners)
  22.       {
  23.          if(this.aListeners[_loc2_] == __oRef)
  24.          {
  25.             delete this.aListeners[_loc2_];
  26.             this.aListeners.splice(Number(_loc2_),1);
  27.          }
  28.       }
  29.    }
  30.    function doPause()
  31.    {
  32.       this.bPaused = true;
  33.       this.doDispatchMessage("doPause");
  34.    }
  35.    function doResume()
  36.    {
  37.       this.bPaused = false;
  38.       this.doDispatchMessage("doResume");
  39.    }
  40.    function doDestroy()
  41.    {
  42.       delete this.aListeners;
  43.    }
  44.    function doDispatchMessage(__sMessage)
  45.    {
  46.       for(var _loc3_ in this.aListeners)
  47.       {
  48.          this.aListeners[_loc3_].__sMessage();
  49.       }
  50.    }
  51. }
  52.